/*!
    @header EntitiesImporter
    @abstract A EntitiesImporter allows you to import the content of entities from a xml file.
	@discussion A EntitiesImporter only needs to know where the XML file (containing entities) is.
*/

#import <Cocoa/Cocoa.h>
#import "MO2XMLCoreDataAccess.h"

@interface MO2XMLEntitiesImporter : MO2XMLCoreDataAccess {
	NSString *path;
	NSDictionary *properties;
}

/*!
    @method initWithContentsOfFile    
    @result Returns a initialized EntitiesImporter object with the contents of the file specified by aPath.
*/
- (id)initWithContentsOfFile:(NSString *)aPath;
- (void)dealloc;

/*!
    @method importEntities   
	@discussion Imports the entities which are stored in the XML file defined with setPath:(NSString *).
	@result Returns YES if everything went fine. Returns NO if something went wrong.
*/
- (BOOL)importEntities;

/*!
    @method path   
	@result The path which is used by the entities importer instance.
*/ 
- (NSString *)path;

/*!
    @method setPath   
	@discussion Sets the path used by the entities importer instance.
*/ 
- (void)setPath:(NSString *)value;
- (NSArray *)entitiesAsDictionaries;

/*!
    @method properties    
    @result Returns the property dictionary which you can set with setProperties:(NSDictionary *)
*/
- (NSDictionary *)properties;

/*!
    @method setProperties    
	@discussion You can use a dictionary to change every imported managed object. The keys of
	this dictionary are the corresponding properties of the managed objects and the values of the dictionary 
	are the corresponding values of the managed object. If you pass a dictionary containing an object
	with the key "age" and the value "1" then every property "age" of the imported managed objects 
	will be set to 0. You can also define relationships with this dictionary of properties.
    @param value A dictionary defining the properties of each imported managed object.
*/
- (void)setProperties:(NSDictionary *)value;

@end
